package de.uniLuebeck.tcs.algorithmics;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;

public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		long	startZeit = 0;
		long	endZeit = 0;
		
		/*
		 * Start der Zeitmessung
		 * ---------------------
		 */
		startZeit = System.currentTimeMillis();
		Sudoku sudoku = new Sudoku();
		
		
		try {
			BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream( "sampleInput.txt" )));
			BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream( "sampleOutput.txt" )));
		
			
			sudoku.solveProblem(reader,writer);
			endZeit = System.currentTimeMillis();
			/*
			 * --------------------
			 * Ende der Zeitmessung
			 */
			
			/*
			 * Ausgabedatei mit dem Dateisystem synchronisieren
			 */
			writer.flush();
			
			System.out.println("Duration: " + (endZeit - startZeit) + " msec.\n");
			

		} catch (FileNotFoundException e) {
			e.printStackTrace();
			
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}
